<?php
$x = ", nih,ao,";

echo trim ($x, ",");

?>

